package edu.clemson.wcbeck.cft;

import android.app.ProgressDialog;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class CFTTeamTabs extends TabActivity{

	public static ProgressDialog myProgressDialog = null;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.team);   
        
        Bundle myBundle = this.getIntent().getExtras();
        
        Resources res = getResources(); // Resource object to get Drawables
        TabHost tabHost = getTabHost();  // The activity TabHost
        TabHost.TabSpec spec;  // Reusable TabSpec for each tab
        Intent intent;  // Reusable Intent for each tab

        // Create an Intent to launch an Activity for the tab (to be reused)
        intent = new Intent().setClass(this, CFTTeamSongs.class);
        intent.putExtras(myBundle);

        // Initialize a TabSpec for each tab and add it to the TabHost
        spec = tabHost.newTabSpec("songs").setIndicator("Songs",
                          res.getDrawable(R.drawable.ic_tab_songs))
                      .setContent(intent);
        tabHost.addTab(spec);

        
        // Do the same for the other tabs
        intent = new Intent().setClass(this, CFTTeamWallpaper.class);
        intent.putExtras(myBundle);        
        spec = tabHost.newTabSpec("wallpaper").setIndicator("Wallpaper",
                          res.getDrawable(R.drawable.ic_tab_wallpaper))
                      .setContent(intent);
        tabHost.addTab(spec);

        
        intent = new Intent().setClass(this, CFTTeamNews.class);
        intent.putExtras(myBundle);        
        spec = tabHost.newTabSpec("news").setIndicator("News",
                          res.getDrawable(R.drawable.ic_tab_news))
                      .setContent(intent);
        tabHost.addTab(spec);
        
        intent = new Intent().setClass(this, CFTTeamMap.class);
        intent.putExtras(myBundle);        
        spec = tabHost.newTabSpec("map").setIndicator("Map",
                          res.getDrawable(R.drawable.ic_tab_map))
                      .setContent(intent);
        tabHost.addTab(spec);

        tabHost.setCurrentTab(0);
        
        
        
        
        
        
    }
}
